/* 
 * 创建日期 2011-5-5
 *
 * 成都天和软件公司
 * 电话：028-85425861 
 * 传真：028-85425861-8008 
 * 邮编：610041 
 * 地址：成都市武侯区航空路6号丰德万瑞中心B座1001 
 * 版权所有
 */
package  org.fantasy.cpp.web.filter;

import java.io.IOException;

import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import org.jwebap.plugin.tracer.http.DetectFilter;

/**
 * 编码纠正
 * @author 王文成
 * @version 1.0
 * @since 2011-5-5
 */
public class CipDetectFilter extends DetectFilter{
	
	private String charset;

	@Override
	public void init(FilterConfig filterConfig) throws ServletException {
		this.charset=filterConfig.getInitParameter("charset");
		super.init(filterConfig);
	}


	@Override
	public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException,
			ServletException {
		request.setCharacterEncoding(charset);
		super.doFilter(request, response, filterChain);
	}
}
